package com.top.mall.main.home

import android.app.Activity
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import com.blankj.utilcode.util.ActivityUtils
import com.blankj.utilcode.util.BarUtils
import com.module.lemlin.owner.OwnerViewModeActivity
import com.top.mall.R
import com.top.mall.jetpack.vm.CouponViewModel
import kotlinx.android.synthetic.main.activity_message_details.*

class MessageDetailsActivity : OwnerViewModeActivity<CouponViewModel>() {

    companion object {
        private const val KEY_MESSAGE_TITLE = "KEY_MESSAGE_TITLE"
        fun open(title: String) {
            val bundle = Bundle().apply {
                putString(KEY_MESSAGE_TITLE, title)
            }
            ActivityUtils.startActivity(bundle, MessageDetailsActivity::class.java)
        }
    }

    private val mTitle:String
    get() = intent?.extras?.getString(KEY_MESSAGE_TITLE)?:""

    override fun viewModel(): CouponViewModel {
        return createViewModel()
    }

    override val layoutResId: Int
        get() = R.layout.activity_message_details

    override fun stateBar(): StatusBar {
        return StatusBar(color = R.color.colorWhite, view = flMessageDetailsBar)
    }

    override fun initView() {

        imageViewBack.setOnClickListener { finish() }
        tvMessageDetailsTitle.text = mTitle
    }

    override fun initData() {

    }

}